<template>
	<view class="calssLayout pageBg">
		<!-- 上面的固定搜索栏 -->
		<custom-nav-bar title="分类"></custom-nav-bar>
		<view class="calssify">
			<theme-item v-for="item in classifyList" 
			:key="item._id"
			:item="item"
			
			></theme-item>
		</view>
	</view>
</template>

<script lang="ts" setup>
	import { ref } from "vue";
	import {apiGetClassify} from "@/api/apis.js"
	import {onShareAppMessage,onShareTimeline}  from"@dcloudio/uni-app"
	const classifyList = ref([]);
	
	
	
	/* 专题精选的东西直接丢分类大页面这里 */
	const getClassify = async()=>{
		let res =await apiGetClassify({
			pageSize:20
		});
		console.log(res);
		classifyList.value=res.data
		
	}
	
	getClassify();
	
	//分享给好友,这个是分享的函数nShareAppMessage 官方的
	onShareAppMessage((e) => {
		return {
			title: "王同学的壁纸库,精选分类",
			path: "pages/classify/classify"
		}
	})
	//分享朋友圈 需要权限，要不就是用小程序测试号的appid
	//测试号id是wx04394c05eeb40715
	//主号用的是wxd4651c59239cb9b7
	onShareTimeline(() => {
		return {
			title: "王同学的壁纸库,精选分类",
			imageUrl: "/static/images/logo2.jpg"
		}
	})
	
</script>

<style lang="scss" scoped>
	       .calssify{
			   padding: 30rpx ;
			   display: grid;
			   grid-template-columns: repeat(3,1fr);
			   gap: 15rpx;
			   
		   }
</style>
